package com.mm.cloth.model.response;

import com.mm.cloth.model.Clothes;

import java.util.List;

/**
 * 衣物列表响应模型类
 * 对应获取衣物列表接口的响应数据
 * 参考UniApp项目的响应格式：{code: 200, data: {list: [...], total: ...}}
 */
public class ClothesListResponse {

    private List<Clothes> list;      // 衣物列表，对应UniApp项目中的list字段
    private int total;               // 总记录数
    private int currentPage;         // 当前页码
    private int pageSize;            // 每页记录数
    private int totalPages;          // 总页数

    public ClothesListResponse() {
    }

    /**
     * 获取衣物列表
     * @return 衣物列表
     */
    public List<Clothes> getList() {
        return list;
    }

    public void setList(List<Clothes> list) {
        this.list = list;
    }

    /**
     * 为了兼容旧代码，保留getItems方法
     * @return 衣物列表
     */
    public List<Clothes> getItems() {
        return list;
    }

    public void setItems(List<Clothes> items) {
        this.list = items;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }

    /**
     * 判断是否为最后一页
     * @return 是否为最后一页
     */
    public boolean isLastPage() {
        return currentPage >= totalPages;
    }
}